package homework;

public class Homework14 {
	public static void main(String[] args) {
		// 将一个整数分解质数因子，90 = 2 * 3 * 3 * 5 (单层循环)
		// 90开始从2开始除(除不开自增)，直到除成1为止
		
		int num = 1250;
		int copy = num;  // 90
		System.out.print(num + " = ");
		
		for(int i = 2; copy != 1; i++) {
			if (copy % i == 0) {
				if (copy == i) {
					System.out.print(i);
				}else {
					System.out.print(i + " * ");
				}
				copy /= i;  // copy = 45,15,5,1
				i--;
			}
		}
	}
}
